package com.bappi.custom.activities;

import android.app.ActivityGroup;
import android.app.ListActivity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.KeyEvent;

public class CustomListActivity extends ListActivity implements CustomActivityInterface{
	private CustomActivityGroup parent;
	private Object rData;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		parent = (CustomActivityGroup)getParent();
	}
	public void setResultData(Object result){
		this.rData = result;
	}
	public Object getResultResult(){
		return rData;
	}
	public void intentDataSent(Object intentData) {
	}
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event)
	{
		if(keyCode == KeyEvent.KEYCODE_BACK)
		{
			parent.finish();
			return true;
		}
		return super.onKeyDown(keyCode, event);
	}
	public void finish() {
//		parent.finish();
		parent.back();
	}
	public void pushIntnet(Intent intent){
		parent.pushIntent(intent);
	}
	public void pushIntnet(Intent intent,Object iData){
		parent.pushIntent(intent,iData);
	}
	public void finishAll(){
		parent.forceBack();
	}
	public void willFinish(){
		
	}
	public void willResume(Object result){
		
	}
	public void orientstionChanged(Configuration newConfig){	
	}
	public void onActivityResult(int requestCode, int resultCode, Intent data,ActivityGroup parent){
	}
}
